import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './data/axios.js'
import "./permission"; // permission control
import './concise/index.js'
import "./data/api"
import "./mock/index.js"

import Router from 'vue-router';
Vue.use(Router)
// 解决报错
const originalPush = Router.prototype.push
const originalReplace = Router.prototype.replace
// push
Router.prototype.push = function push (location, onResolve, onReject) {
    if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
    return originalPush.call(this, location).catch(err => err)
}
// replace
Router.prototype.replace = function push (location, onResolve, onReject) {
    if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject)
    return originalReplace.call(this, location).catch(err => err)
}

// 引入图标库
import './style/iconfont/iconfont.css'
import VueParticles from 'vue-particles'

//禁止输入特殊字符
Vue.prototype.validForbid = function (value) {
    value = value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~！@#￥%……&*（）——\-+={}|《》？：“”【】、；‘’，。、]/g, '').replace(/\s/g, "");
    return value;
}


Vue.config.productionTip = false
import { Loading,Empty } from 'vant';
Vue.use(Loading).use(VueParticles).use(Empty)
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')